package com.cyh.testdesignpattern.state;

import android.util.Log;

//不能抽奖的状态
public class NoRaffleState extends State {
    //初始化时传入活动引用，扣除积分后改变其状态
    RaffleAction action;

    public NoRaffleState(RaffleAction action) {
        this.action = action;
    }

    //当前状态可以扣除积分，扣除后，将状态设置成可以抽奖状态
    @Override
    public void deductMoney() {
        Log.i("NoRaffleState", "扣除50积分成功， 您可以抽奖了");
        action.setState(action.getCanReffleState());
    }

    //当前状态不能抽奖
    @Override
    public boolean raffle() {
        Log.i("NoRaffleState", "扣除了积分才能抽奖哦！");
        return false;
    }

    //当前状态不能发放奖品
    @Override
    public void dispensePrize() {
        Log.i("NoRaffleState", "当前状态不能发放奖品！");
    }
}
